<template>
	<view>
		<view class="mask"></view>
		<view class="zt-modal animated bounceInUp">
			<view class="title">
				{{ title }}
			</view>
			<view class="info">
				{{ info }}
			</view>
			<view class="bottom-btn">
				<view class="btn-left" @click="clickLeft">
					<template v-if="cancelText !== ''">
						<button type="default" plain="true">{{ cancelText }}</button>
					</template>
					<slot name="left"></slot>
				</view>
				<view style="width: 10rpx;"></view>
				<view class="btn-right" @click="clickRight">
					<template v-if="confirmText !== ''">
						<button type="default" plain="true">{{ confirmText }}</button>
					</template>
					<slot name="right"></slot>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				
			}
		},
		props:{
			title:{
				type:String,
				default:"提示"
			},
			info:{
				type:String,
				default:"主要内容"
			},
			cancelText:{
				type:String,
				default:''
			},
			confirmText:{
				type:String,
				default:''
			}
		},
		methods:{
			clickLeft(){
				this.$emit('clickLeft')
			},
			clickRight(){
				this.$emit('clickRight')
			}
		}
	}
</script>

<style lang="scss" scoped="scoped">
	.mask{
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: 0;
		background: rgba(0,0,0,0.5);
		z-index: 9998;
	}
	.zt-modal{
		position: absolute;
		bottom: 40rpx;
		left: 0;
		right: 0;
		text-align: center;
		margin: auto;
		z-index: 9999;
		width: 600rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		padding: 10rpx 10rpx;
		.title{
			padding: 10rpx 0;
			color: #000;
		}
		.info{
			padding: 30rpx 0;
			color: #999999;
		}
		.bottom-btn{
			display: flex;
			justify-content: space-between;
			align-items: center;
			.btn-left,.btn-right{
				flex: 1;
			}
		}
	}
</style>
